﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/bootstrap/css/bootstrap.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/bootstrap/css/bootstrap-responsive.min.css")" rel="stylesheet" type="text/css"/>
    <link href="@Url.Content("~/Content/themes/base/jquery-ui-1.10.1.custom.min.css")" rel="stylesheet" type="text/css"/>
    <link href="@Url.Content("~/Content/ui.jqgrid.css")" rel="stylesheet" type="text/css"/>
    <script src="@Url.Content("~/Scripts/jquery-1.9.1.min.js")" type="text/javascript"> </script>
    <script src="@Url.Content("~/Scripts/bootstrap.min.js")" type="text/javascript"> </script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.10.1.custom.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/grid.locale-cn.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.blockUI.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Common.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-timepicker-addon.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.jqGrid.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.jqGrid.locale-cn-4.4.0.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.pager.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Validation.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/App.css")" rel="stylesheet" type="text/css"/>
    @RenderSection("HeadSection", false)
    @{
        var controller = ViewContext.RouteData.Values["controller"].ToString();
        var action = ViewContext.RouteData.Values["action"].ToString();
    }
</head>
<body  data-spy="scroll" data-target=".bs-docs-sidebar">
    <div class="navbar navbar-inverse navbar-static-top navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
                    <a class="brand" href='@Url.Action("Index", "Home")'>退出</a>
                    <a class="brand" href="@Url.Action("Index", "Home")">欢迎您:程序猿!</a>
                    
                    <div class="nav-collapse collapse">
                        <ul class="nav">
                            @RenderMenuItem("首页", "Index", "Home", "icon-home")
                            <li id="commonTools" class="dropdown  @("CommonTools".Equals(controller, StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)">
                                <a href="#commonTools" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-wrench @("CommonTools".Equals(controller, StringComparison.InvariantCultureIgnoreCase) ? "icon-white" : string.Empty)">
                                </i>常用工具 <span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    @RenderSubMenuItem1("DES", "DES", "CommonTools", "icon-th-list")
                                    @RenderSubMenuItem1("MD5", "MD5", "CommonTools", "icon-th")
                                    @RenderSubMenuItem1("通讯录", "Employees", "CommonTools", "icon-th")
                                    @RenderSubMenuItem1("服务器列表", "Servers", "CommonTools", "icon-th")
                                </ul>
                            </li>
                            <li class="divider-vertical"></li>
                            <li id="dbTools" class="dropdown @("DbTools".Equals(controller, StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)">
                                <a href="#dbTools" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-thumbs-down @("DbTools".Equals(controller, StringComparison.InvariantCultureIgnoreCase) ? "icon-white" : string.Empty)">
                                </i>数据库工具 <span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    @RenderSubMenuItem1("表结构查看", "Index", "TableView", "icon-eye-open")
                                    @*@RenderSubMenuItem1("表结构设计", "TableDesign", "DbTools", "icon-tasks")*@
                                    @RenderSubMenuItem1("代码生成器", "Index", "CodeGenerate", "icon-hdd")
                                    @RenderSubMenuItem1("表分组设置", "Index", "TableGroup", "icon-tasks")
                                </ul>
                            </li>
                            @*<li id="sysVersion" class="dropdown @("SysVersion".Equals(controller, StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)">
                                <a href="#sysVersion" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-facetime-video @("SysVersion".Equals(controller, StringComparison.InvariantCultureIgnoreCase) ? "icon-white" : string.Empty)">
                                </i>版本日志管理 <span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    @RenderSubMenuItem1("发版日志", "Index", "SysVersion", "icon-file")
                                    @RenderSubMenuItem1("历史版本日志管理", "VersionManage", "SysVersion", "icon-film")
                                </ul>
                            </li>*@
                            @RenderMenuItem("关于", "About", "Home", "icon-user")
                        </ul>
                    </div>
                </div>
            </div>
        </div>

    <div class="container">
        <div class="row">
            @RenderBody()
        </div>
    </div>
    
    <footer class="footer">
            <div class="container">
                <p class="pull-right"><a href="#">Back to top</a></p>
                <p>仰望星空 脚踏实地 帮助他人 成就自我</p>
            </div>
    </footer>
</body>
@helper RenderMenuItem(string text, string action, string controller, string icon)
    {
        bool isActive = action.Equals(ViewContext.RouteData.Values["action"].ToString(), StringComparison.InvariantCultureIgnoreCase) &&
            controller.Equals(ViewContext.RouteData.Values["controller"].ToString(), StringComparison.InvariantCultureIgnoreCase);
    <li class="@(isActive ? "active" : string.Empty)"><a href="@Url.Action(action, controller)">
        <i class="@icon @(isActive ? "icon-white" : string.Empty)"></i>
        @text
    </a></li>
    <li class="divider-vertical"></li>
}
@helper RenderSubMenuItem1(string text, string action, string controller, string icon)
    {
        bool isActive = action.Equals(ViewContext.RouteData.Values["action"].ToString(), StringComparison.InvariantCultureIgnoreCase) &&
                        controller.Equals(ViewContext.RouteData.Values["controller"].ToString(), StringComparison.InvariantCultureIgnoreCase);
    <li class="@(isActive ? "active" : string.Empty)"><a href="@Url.Action(action, controller)">
        <i class="@icon @(isActive ? "icon-white" : string.Empty)"></i>
        @text
    </a></li>
    <li class="divider"></li>
}
</html>
